﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall;
using FlatRedBall.Math.Geometry;
using Microsoft.Xna.Framework;
using FlatRedBall.Input;
using TopDownShooter.Screens;

namespace TopDownShooter
{
    class Crosshair : PositionedObject
    {
        Line line1;
        Line line2;
        GameScreen m_Screen;
        public Crosshair(GameScreen screen)
        {
            line1 = ShapeManager.AddLine();
            line2 = ShapeManager.AddLine();

            line1.SetFromAbsoluteEndpoints(new Vector3(1, 0, 0), new Vector3(-1, 0, 0));
            line2.SetFromAbsoluteEndpoints(new Vector3(0, 1, 0), new Vector3(0, -1, 0));

            line1.AttachTo(this, false);
            line2.AttachTo(this, false);

            line1.RelativeX = -.5f;
            line2.RelativeY = -1f;

            m_Screen = screen;
        }

        public void Activity()
        {
            X = InputManager.Mouse.WorldXAt(0);
            Y = InputManager.Mouse.WorldYAt(0);
        }

        public void Destroy()
        {
            ShapeManager.Remove(line1);
            ShapeManager.Remove(line2);
        }
    }
}
